package com.example.commom.util.remote;

import lombok.Data;

/**
 * @author: bebm
 * @date: 2022/4/2 17:04
 * @description:
 */
@Data
public class RemoteProperties {

    /**
     * 需要前置任务完成结果
     */
    private boolean preRequired;
    /**
     * 无返回结果
     */
    private RemoteTransferHandler remoteTransferHandler;
    /**
     * 回滚处理
     */
    private RemoteRollbackHandler remoteRollbackHandler;
    /**
     * 返回结果
     */
    private RemoteTransferCallbackHandler remoteTransferCallbackHandler;
    /**
     * 结果
     */
    private String result;
    /**
     * 获取结果索引
     */
    private Integer resultIndex;

    public RemoteProperties(RemoteTransferHandler remoteTransferHandler, RemoteRollbackHandler remoteRollbackHandler) {
        this.preRequired = false;
        this.remoteTransferHandler = remoteTransferHandler;
        this.remoteRollbackHandler = remoteRollbackHandler;
    }

    public RemoteProperties(RemoteTransferCallbackHandler remoteTransferCallbackHandler, RemoteRollbackHandler remoteRollbackHandler, Integer resultIndex) {
        this.preRequired = true;
        this.remoteTransferCallbackHandler = remoteTransferCallbackHandler;
        this.remoteRollbackHandler = remoteRollbackHandler;
        this.resultIndex = resultIndex;
    }




}
